import http from '@/utils/http/axios'
import {ContentTypeEnum} from '@/enums/httpEnum'

enum Api {
    fileFilelist = '/file/filelist', // 获取证书列表
    fileDelete = '/file/delete', // 删除证书
    fileUpload = '/file/upload', // 上传证书
    fileExist = '/file/exist',
}

/**
 * @description: 上传证书
 */
export function fileUpload(params: any) {
    return http.uploadFiles({
        url: Api.fileUpload,
        method: 'POST',
    }, params, {isTransformRequestResult: false})
}

/**
 * @description: 删除证书
 */
export function fileDelete(params: any) {
    return http.request({
        url: Api.fileDelete,
        method: 'POST',
        params,
    })
}

/**
 * @description: 获取证书列表
 */
export function fileFilelist(params: any) {
    return http.request({
        url: Api.fileFilelist,
        method: 'GET',
        params,
    }, {
        isTransformRequestResult: false
    })
}

/**
 * @description: 验证文件存在
 **/
export function fileExist(params: any){
    return http.request({
        url: Api.fileExist,
        method: 'POST',
        params,
    },{
        isTransformRequestResult: true
    })
}
